//
//  UIBarButtonItem+Extension.m
//  BuDeJie
//
//  Created by 许良 on 16/7/22.
//  Copyright © 2016年 fading. All rights reserved.
//

#import "UIBarButtonItem+Extension.h"

@implementation UIBarButtonItem (Extension)

+(instancetype)itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)targer action:(SEL)action
{
    UIButton *Btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [Btn setBackgroundImage :[UIImage imageNamed:image] forState:UIControlStateNormal];
    [Btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    Btn.size = Btn.currentBackgroundImage.size;
    [Btn addTarget:targer action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[self alloc]initWithCustomView:Btn];
}
@end
